]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
js/main: Throw error if no valid default stylesheet is found
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Wed, 15 Aug 2018 01:33:13 +0000 (03:33 +0200)
committerMarco Trevisan <mail@3v1n0.net>
Mon, 3 Sep 2018 23:29:01 +0000 (23:29 +0000)
Throw an error using an informative message in case a mode uses a stylesheet
that can't be loaded, instead of crashing later because the theming can't be
properly computed, and thus the minimum size of the actors.

js/ui/main.js

index e107de7444c871cf6338f9e8bb1c1fb7c03a69ec..9e7ce8706fd56e21367327b6db9dc91680841263 100644 (file)
@@ -343,6 +343,9 @@ function loadTheme() {
     let theme = new St.Theme ({ application_stylesheet: _cssStylesheet,
                                 default_stylesheet: _defaultCssStylesheet });
 
+    if (theme.default_stylesheet == null)
+        throw new Error("No valid stylesheet found for '%s'".format(sessionMode.stylesheetName));
+
     if (previousTheme) {
         let customStylesheets = previousTheme.get_custom_stylesheets();